﻿// JScript File
/// <reference path="Container.js" />
/// <reference path="_namespace.js" />


/*****************************************************************************
Ajax library class definition. Kevin Robinson 2006.
Class: ajax.components.Container
/*****************************************************************************/

ajax.lang.addNamespace("ajax.components");

//-----------------------------------------------------------------------------	
ajax.components.AjaxContainer = function(doc, parentNode, layerName, w, h)
{            
    ajax.components.AjaxContainer.superConstructor.call(this, doc, parentNode, layerName, w, h);
    
    // Ajax specific Objects
    this.progressIndicator = null;
    
    // Listen for our own onLoad - because many subclasses will not want to call base when loading & creating.
    this.getEvent(this.window, "onLoad").addListener(this.createProgressIndicator.bind(this));
}

//-----------------------------------------------------------------------------	
ajax.lang.extend("ajax.components.AjaxContainer", "ajax.components.Container");

ajax.components.AjaxContainer.prototype.progressIndicator = null;

//-----------------------------------------------------------------------------	
// Override create
ajax.components.AjaxContainer.prototype.createProgressIndicator = function()
{       
    // Create progress indicator
    this.progressIndicator = ajax.lang.safeNew("ajax.components.ProgressIndicator", this.doc, this.layer, "", 32, 32, ajax.getDomainPath() + "/images/ajax-loader1.gif"); 
}

ajax.components.AjaxContainer.prototype.getProgressIndicator = function()
{///<returns type="ajax.components.ProgressIndicator"/>
    if (!this.progressIndicator)
        this.createProgressIndicator();
    return this.progressIndicator;
}

//-----------------------------------------------------------------------------	
ajax.components.AjaxContainer.prototype.toString = function()
{
    return "ajax.components.AjaxContainer";
}

//-----------------------------------------------------------------------------
ajax.components.AjaxContainer.cast = function(obj)
{///<returns type="ajax.components.AjaxContainer"/>
    return obj;
}